/* main.c */

#include <avr/io.h>

uint8_t state = 0;

int main(void)
{
   DDRB |= (1 << PB5);

   while (1)
   {
      if (PIND & (1 << PD7)) {
         if (state == 0) {
            PORTB |= (1 << PB5);
            state = 1;
         } else {
            PORTB &= ~(1 << PB5);
            state = 0;
         }
      }
   }

   return 0;
}
